﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Practices.EnterpriseLibrary.Data;
using Enterprise.DataFactory;
using Enterprise.Infrastructure;
using Enterprise.Model.Meeting;
namespace Enterprise.Data.Meeting
{
    /// <summary>
    /// 会议签收
    /// </summary>
    public class MeetingRecevieData
    {
        /// <summary>
        ///  签收数据列表
        /// </summary>
        /// <returns></returns>
        public List<MeetingRecevieEntity> MeetingRecevieList()
        {
            List<MeetingRecevieEntity> list = new List<MeetingRecevieEntity>();
            string cmd = "Select * from MEETING_RECEVIE";
            IDataReader dr = DbExecute.DataReader(cmd);
            while (dr.Read())
            {
                MeetingRecevieEntity entity = new MeetingRecevieEntity();
                if (!Convert.IsDBNull(dr["MRID"])) entity.MRID = Convert.ToInt32(dr["MRID"]);
                if (!Convert.IsDBNull(dr["MID"])) entity.MID = Convert.ToInt32(dr["MID"]);
                if (!Convert.IsDBNull(dr["MRUSERID"])) entity.MRUSERID = Convert.ToInt32(dr["MRUSERID"]);
                if (!Convert.IsDBNull(dr["MRTIME"])) entity.MRTIME = Convert.ToDateTime(dr["MRTIME"]);
                list.Add(entity);
            }
            dr.Close();
            return list;
        }

        /// <summary>
        /// 签收数据操作方法
        /// </summary>
        /// <param name="cmd"></param>
        public void Execute(string cmd)
        {
            DbExecute.Execute(cmd);
        }
    }
}
